alert("This object does not exist" && thisObjRef && "-old data.")
end repeat
end
on clearScreen
set Templist to []
repeat with thisPos in gScreenState
add(Templist, thisPos)
end repeat
Delobjects(Templist)
end
on newGame
set gLastCursor to getaProp(gCursorList, #NullCursor)
set the loc of sprite sCURSORSPRITE to point(-2000, -2000)
startTheTimer(1, "NewGameTimer")
JumpToKey(#A00)
end
on NewGameTimer
InitgObjects()
InittheTimer()
setaProp(gStates, #EnviroLetter, "A")
JumpToKey(#A03)
end
on DoOpenGame
if gdirty <> 1 then
beep()
exit
end if
set gdirty to 0
makeDynamic(#SaveOBj, #Aquired, 0)
CloseOpenUNVDialog()
startTheTimer(1, "OpenGameTimer")
stopSound(#ALL)
stopSound(2)
set gSoundChannels to [:]
JumpToKey(#trans)
makeDynamic(#SaveOBj, #Aquired, 1)
end
on OpenGameTimer
InitgObjects()
set JumpRef to OpenGameDataLoad()
InittheTimer()
setaProp(gStates, #EnviroLetter, char 1 of the movieName)
if JumpRef <> #BAD then
JumpToKey(JumpRef)
ADDUnvOBJECTS()
else
setaProp(gStates, #EnviroLetter, "A")
NewGameTimer()
end if
end
on OpenGameDataLoad
if loadGameData() then
set NextKeyRef to getaProp(gStates, #curKey)
if voidp(NextKeyRef) then
set NextKeyRef to #BAD
displayChaosError(#severe, "The Data File is Corrupted" & RETURN & "See openGameDataLoad")
end if
else
set NextKeyRef to #BAD
displayChaosError(#severe, "The Data File has been Altered" & RETURN & "See openGameDataLoad")
end if
return NextKeyRef
end
on SuppendCurrentKF
set aTime to the timer
set the timer to -(the maxinteger)
setSoundState(#pause)
set gQTcharState to [#loc: the loc of sprite sQTCharSprite, #movieTime: the movieTime of sprite sQTCharSprite, #movieRate: the movieRate of sprite sQTCharSprite, #fileName: the fileName of cast cNUllCharmovie, #sound: the sound of cast cNUllCharmovie, #loop: the loop of cast cNUllCharmovie, #pausedAtStart: the pausedAtStart of cast cNUllCharmovie, #timer: aTime, #gSoundChannels: gSoundChannels]
set gSoundChannels to [:]
set the movieRate of sprite sQTCharSprite to 0
set the sound of cast cNUllCharmovie to 1
set the loop of cast cNUllCharmovie to 0
set the pausedAtStart of cast cNUllCharmovie to 1
set the loc of sprite sQTCharSprite to point(-2000, -2000)
updateStage()
set C to sQTCharSprite - 1
set Animators to []
repeat with X = 2 to C
set ObjRef to getaProp(gScreenState, X)
if not voidp(ObjRef) then
set Anim to getaProp(getaProp(gOBJECTS, ObjRef), #Animator)
if not voidp(Anim) then
set CurState to the pbPauseState of Anim
set the pbPauseState of Anim to 1
add(Animators, [#Anim: Anim, #State: CurState])
end if
end if
end repeat
setaProp(gQTcharState, #Animators, Animators)
set gHaveNavs to #false
DELUnvOBJECTS()
set gTempHotRects to gHotRects
set gHotRects to [:]
sort(gHotRects)
end
on ReinstateCurrentKF FileJump
if FileJump <> #true then
set gHotRects to gTempHotRects
sort(gHotRects)
set the fileName of cast cNUllCharmovie to getaProp(gQTcharState, #fileName)
set the sound of cast cNUllCharmovie to getaProp(gQTcharState, #sound)
set the pausedAtStart of cast cNUllCharmovie to getaProp(gQTcharState, #pausedAtStart)
set the loop of cast cNUllCharmovie to getaProp(gQTcharState, #loop)
set the loc of sprite sQTCharSprite to getaProp(gQTcharState, #loc)
set the movieTime of sprite sQTCharSprite to getaProp(gQTcharState, #movieTime)
set the movieRate of sprite sQTCharSprite to getaProp(gQTcharState, #movieRate)
set Animators to getaProp(gQTcharState, #Animators)
repeat with Anim in Animators
set the pbPauseState of getaProp(Anim, #Anim) to getaProp(Anim, #State)
end repeat
ADDUnvOBJECTS()
set gSoundChannels to getaProp(gQTcharState, #gSoundChannels)
setSoundVolumes()
setSoundState(#play)
else
if FileJump = #true then
set the fileName of cast cNUllCharmovie to string(gCDName & "DATA" & gfileSep & "QTDummy.MOV")
set gSoundChannels to [:]
sort(gSoundChannels)
setSoundVolumes()
end if
end if
set gHaveNavs to #true
set the timer to getaProp(gQTcharState, #timer)
end
on doNothing
pass()
end
on OpenUNVDialog
SuppendCurrentKF()
loadNames()
saveTempText()
unselectList()
ADDObjects([#OpenDialogBox])
updateStage()
end
on CloseOpenUNVDialog
Delobjects([#OpenDialogBox])
ReinstateCurrentKF()
deleteProp(gStates, #dynamicData)
unselectList()
when keyDown then nothing
updateStage()
end
on SaveUNVDialog
SuppendCurrentKF()
DELUnvOBJECTS()
loadNames()
saveTempText()
ADDObjects([#SaveDialogBox])
updateStage()
when keyDown then processInputFieldChar "SaveName"
end
on CloseSaveUNVDialog
Delobjects([#SaveDialogBox])
ReinstateCurrentKF()
deleteProp(gStates, #dynamicData)
unselectList()
when keyDown then nothing
updateStage()
end
on OpenNewGameDialog
ADDObjects([#NewGameDialog])
updateStage()
end
on closeNewGameDialog
Delobjects([#NewGameDialog])
cursor([the number of cast "NullCursor", the number of cast "NullCursor.mask"])
end
on OpenGameNow
set gHotRects to [:]
sort(gHotRects)
OpenUNVDialog()
end
on StartNewGame
closeNewGameDialog()
if the movieName contains "intro" then
cursor([the number of cast "NullCursor", the number of cast "NullCursor.mask"])
go("Intro QT")
else
newGame()
end if
end
on DoSaveCancel
CloseSaveUNVDialog()
put gTempDialogText into field getaProp(getaProp(getaProp(gOBJECTS, #SaveNameText), #cast), #text)
set gTempDialogText to EMPTY
if getaProp(getaProp(gOBJECTS, #QuitYetDialog), #gQuitAfter) = 1 then
halt()
end if
end
on DoOpenCancel
CloseOpenUNVDialog()
put gTempDialogText into field getaProp(getaProp(getaProp(gOBJECTS, #SaveNameText), #cast), #text)